<!DOCTYPE html>
<html>

<head>
    <!-- 垂直对齐测试 -->
    <meta charset="utf-8">
    <meta charset="utf-8">
    <title>垂直对齐测试</title>
    <style>
        .box{
            height: 200px;
            line-height: 200px;

            font-size: 40px;
            color: cadetblue;
            background-color: darkmagenta;
        }

        .block{
            width: 40px;
            height: 40px;
            display: inline-block;
            background-color: black;
        }

        /* 模拟行内框 */
        .inline-box{
            display: inline-block;
            border: 1px dashed white;
        }

    </style>
</head>

<body>
    <div class="box">
        这是一段<div class="block"></div>x
        
        <div class="inline-box"><span style="background-color: red;">x文字</span></div>
        
        axghp
    </div>
    <div class="box">
        axghp a this is a test book axghp a this is a test book axghp a this is a test book axghp a this is a test book axghp a this is a test book
    </div>

</body>

</html>